﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Konst3d.Efficiency
{
    /// <summary>
    /// Collection of IIdentifiable items which can be accessed by its ID.
    /// </summary>
    /// <typeparam name="TItem">Items type.</typeparam>
    /// <typeparam name="TId">Identifier type.</typeparam>
    public interface IIdentifiableCollection<TItem, TId> : IEnumerable<TItem> where TItem : IIdentifiable<TId>
    {
        int Count
        {
            get;
        }

        TItem this[TId id]
        {
            get;
        }

        bool Contains(TId id);

        void Add(TItem item);
        void Remove(TId id);
        void Clear();
    }
}
